import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    children:[
      {
        path: '/order/orderm',
        component:() => import('../views/order/orderm.vue')
      },
      {
        path: '/personManage/roleList',
        component: () => import('../views/personManage/RoleListView')
      },
      {
        path: '/personManage/limitList',
        component: () => import('../views/personManage/LimitListView')
      },
      {
        path: '/personManage/UserList',
        component: () => import('../views/personManage/UserListView')
      },
      {
        path: '/workTable',
        component: () => import('../views/default/workTable.vue')
      },
      {
        path: '/default/function',
        component: () => import('../views/default/FunctionView.vue')
      },
      {
        path: '/stock/stockList',
        component: () => import('../views/stock/StockList.vue')
      },
    ]
  },
  {
    path: '/user/reg',
    component: () => import( '../views/user/RegView.vue')
  },
  {
    path: '/user/login',
    component: () => import('../views/user/LoginView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
